﻿using IDbConnectionExtend;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace IDbConnetionExtendTest
{
    public class MyUnitWorker : IUnitWorker
    {
        public IDbConnection DbConnection { get; }
        private UnitWorker unitWorker;
        public MyUnitWorker()
        {
            unitWorker = new UnitWorker(new MySqlConnection("server=localhost;port=3306;uid=root;pwd=admin;database=test"));
            DbConnection = unitWorker.DbConnection;
        }
        public void BeginTransaction()
        {
            unitWorker.BeginTransaction();
        }

        public void Commit()
        {
            unitWorker.Commit();
        }

        public void Rollback()
        {
            unitWorker.Rollback();
        }

        public void Dispose()
        {
            unitWorker.Dispose();
        }
    }
}
